﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace VGSoftware.AutoExtractService.Configuration
{
	public class PlugInConfigurationCollection : ConfigurationElementCollection
	{
		public PlugInConfigurationElement this[int index]
		{
			get
			{
				return base.BaseGet(index) as PlugInConfigurationElement;
			}
			set
			{
				if (base.BaseGet(index) != null)
				{
					base.BaseRemoveAt(index);
				}
				this.BaseAdd(index, value);
			}
		}

		protected override ConfigurationElement CreateNewElement()
		{
			return new PlugInConfigurationElement();
		}

		protected override object GetElementKey(ConfigurationElement element)
		{
			return ((PlugInConfigurationElement)element).Type;
		}
	}
}
